<template>
  <div>
    <el-button type="success" @click="add">添加</el-button>
    <v-dialog :info='info' ref="edi"></v-dialog>
    <v-list @edit="edit"></v-list>
  </div>
</template>

<script>

import vDialog from './components/Dialog.vue'
import vList from './components/List.vue'
import { mapGetters, mapActions } from 'vuex';

export default {
  components:{
    vDialog,
    vList
  },
   data(){
        return{
            info:{
                isShow:false,//控制dialog的显示与隐藏
                title:'',//dialog的标题
                isAdd:true,//是否是添加
            }
        }
    },
    computed:{
      ...mapGetters({

      })
    },
  methods:{
    add(){
      this.info.isShow=true;

    },
    edit(id){
      this.info.isShow=true
      this.info.title="修改",
      this.info.isAdd=false,
      this.$refs.edi.getone(id)
    },
    ...mapActions({
        requestBanner:"banner/bannerActions",
    })
  },
  mounted(){
      this.requestBanner()
  }
};
</script>

<style>
</style>